/* Converts endoded message parts into ucs-4 strings.
 */

#ifndef _KC_8BITCONVERTER_H__KC_
#define _KC_8BITCONVERTER_H__KC_

#include <string>
#include <boost/utility.hpp>
#include <unicode/unistr.h>
#include "../data/MimeDefaults.h"

namespace kc_sf
{
	class _8BitConverter : boost::noncopyable
	{
		public:

			_8BitConverter();
			_8BitConverter( EncodingType enc, const std::string &charset );

			//bool encode (const UnicodeString &input, std::string &output) const;
			bool decode( const std::string &input, UnicodeString &output ) const;

		private:

			EncodingType c_encoding;
			std::string c_charset;

			bool decodeBase64( const std::string &input, UnicodeString &output ) const;
			bool decodeQP( const std::string &input, UnicodeString &output ) const;
			bool decodeNoEncoding( const std::string &input, UnicodeString &output ) const;
	};
}

#endif // _KC_8BITCONVERTER_H__KC_
